package com.github.study;

import com.alibaba.fastjson.JSON;

import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;

/**
 *
 */
public class SyncGoodsPrice {

    private static String[] arr = {"116186","6142790","2840703","118059","6147683","2868989","118098","6147783","2869342","130875","6157158","133524","6159565","134986","6161830","138452","6169986","138568","6170779","176400","6264070","230617","237354","262866","272969","290672","301616","305215","1249787","1275756","1316054","1356444","1389222","1400333","1434620","1478177","1550835","1580974","1609016","1693259","1696121","1915451","1949733","1991057","1991180","2057581","2243912","2252064","2294390","2362046","2390826","2395349","2403550","2403615","2451755","2489649","2510661","2517182","2525767","2528529","2539362","2553559","2709133","2732588","2769063","2840908","2881099","2924418","2959421","2959730","2959998","2999362","3009620","3010035","3010335","3032892","3032930","3067031","3083684","3113284","3113873","3189406","3189436","3194204","3734991","3821140","3821182","4398176","4976372","5500837","5591334","5644084","5648873","5652839","5860392","5906175","5908192","5908350","5911551","6136266","6221454","6406704","6442246","6442877","6442958","6452828","6489548","134920","6161732","244633","1609031","1667863","2294392","4632019","4971178","5492916","5566338","5644544","5680833","5704245","5734358","5895896","5905470","5908149","5909241","5916883","5917646","6244602","6440897","6441623","6442325","6452802","110772","6139382","116149","6142443","2837681","116388","6143679","2842233","116465","6144603","2842677","118015","6147551","118378","6148630","2872865","133659","6159885","136794","6163778","136837","6163847","160786","6218552","176586","6264826","177374","6268052","178248","6270945","184612","184629","237459","244459","245017","246955","270150","286005","289541","305634","305699","1228157","1384304","1400863","1609026","1696127","1743183","1911349","1929316","1929450","1929782","1992428","1992462","1996613","2032587","2045782","2053497","2057778","2183370","2220596","2226927","2228286","2247795","2287248","2355373","2389569","2397564","2413338","2469883","2510658","2539338","2539344","2564167","2937689","2937775","2939451","2959437","3047933","3049992","3074939","3076405","3081872","3189383","3194491","4399028","5587570","5644064","5644103","5734385","5892641","5907207","5908185","5908241","5912162","5913965","5945233","5981824","6441000","6442866","6442923","6452729","6460909","116185","6142789","2847535","118041","6147632","2869922","133123","6159129","136842","6163857","144123","6190315","161998","6220938","206804","244348","270320","272977","319618","326673","1227995","1228303","1409491","1521384","1608960","1696125","1719907","1917517","1929282","2004735","2183348","2191411","2231469","2236730","2362763","2404262","2488144","2563929","2823356","2838323","2883319","2883596","2971285","2994382","3010320","3060308","3076049","3113282","3113903","3113945","3189478","3821153","3967999","5509505","5591330","5629227","5906167","5911966","6136688","6168143","6335764","6335840","6442306","6442315","6442852","6442858","6442913","114993","6142031","2834944","115056","6142122","2835306","116184","6142788","2879722","162619","6145994","2847477","118166","6147981","162005","6220973","230618","244391","244645","290668","305193","1237033","1287559","1416983","1929376","1929477","2045652","2045769","2189891","2226807","2226876","2234523","2237457","2243951","2360685","2372197","2372224","2389564","2394900","2403625","2404048","2406060","2407769","2408304","2442018","2455571","2481727","2488695","2489019","2493203","2773301","2782103","2840885","2883376","2960169","3013762","3019054","3054277","3054419","3113279","3113285","3113725","3189458","3200313","5588444","5590216","5666380","5704115","5911519","5914466","5960257","6043562","6244576","6403610","6421414","6442276","6442928","6452720","6538836","107183","6129404","108468","6133377","109272","6136379","114658","6141367","116138","6142418","2837628","118122","6147835","136920","6164340","138389","6169754","138436","6169945","148403","6208541","189171","202617","214430","241644","243566","244460","248185","271623","283741","290667","290680","290681","305227","1257967","1257979","1275912","1384385","1409464","1643176","1693267","1719897","1719999","1721872","1722381","1918683","1929301","1929335","1929803","1992411","1992484","1992730","1996490","2004791","2032112","2045696","2045725","2068786","2226950","2230952","2231421","2237526","2243818","2372233","2372871","2389574","2389673","2391530","2432956","2451741","2469909","2488789","2507750","2523909","2538593","2539024","2732890","2769040","2838358","2840987","2841085","2881199","2881702","2924403","2948811","2959772","2960032","2961117","2961507","2994374","3000551","3024884","3025323","3050056","3076074","3076386","3082133","3113887","3189429","3194443","3273484","3822630","5815470","5860549","5906702","5907372","5911622","6012264","6052909","6134863","6161137","6168226","6233115","6233308","6335925","6336164","6336183","6348622","6389026","6404932","6421753","6442590","6442874","6460900","6493562","118113","6147820","2869519","137139","6164826","161659","6220389","237571","1720207","1929400","1929856","1949359","1992446","2045747","2068414","2191360","2226914","2236726","2252043","2355490","2372261","2377162","2394932","2423986","2432972","2441368","2450084","2455563","2485221","2498498","2709132","2781877","2838386","2840968","2879810","2881262","2959746","2961565","3028259","3041517","3054354","3054381","3081846","3113926","3821070","4134265","4398547","5589548","5591315","5591340","5678324","5907197","5911576","5914532","6136445","6168044","6336217","6440945","6493384","6493387"};

    public static void main(String[] args){
        List<String> faileds = new ArrayList<>();
        List<String> failedCode = new ArrayList<>();
        String url_ = //"http://super.lvmama.com/tnt-price-back/ticket/compensate/metaPriceSync/{0}/GOODS";
        "http://super.lvmama.com/tnt_price/timePrice/ticket/bak/send.do?channelId=&userId=&ruleLevel=SUPP_GOODS_TIME_PRICE_ADD&priceValue={0}&packType=";
        String url = null;
        for (int i = 0, len = arr.length; i < len; i++) {
            url = MessageFormat.format(url_, arr[i]);
            try {
                String resp = HttpUtil.httpGet(url);
                System.out.println("GOODSID:"+arr[i]+";执行结果："+resp);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        System.out.println(JSON.toJSONString(failedCode));
        for (String r : faileds) {
            System.out.println(r);
        }
    }
}
